#include "SoundPotInstrument.h"



void SoundPot::Instrument::setResponder(InstrumentResponder* responder)
{
	this->responder = responder;
}

bool SoundPot::Instrument::isPermanent() const
{
	return permanent;
}

const std::string& SoundPot::Instrument::getInstrumentID() const
{
	return instrumentID;
}

void SoundPot::Instrument::setInstrumentID(const std::string& value)
{
	instrumentID = value;
}


void SoundPot::Instrument::setPermanent(bool state)
{
	permanent = state;
}

bool SoundPot::Instrument::isEmployed() const
{
	if(assignedSound)
	{
		return true;
	}
	else
	{
		return false;
	}
}


void SoundPot::Instrument::assignSound(Sound* sound)
{
	assignedSound = sound;
	
	// Keep consistency

	if(assignedSound && assignedSound->getAssignedInstrument() != this)
	{
		assignedSound->assignInstrument(this);
	}
}

SoundPot::Sound* SoundPot::Instrument::getAssignedSound()
{
	return assignedSound;
}
